<template>
	<view class="container">
		<template v-if="dataList.length > 0">
			<block v-for="(item,index) in dataList" :key="index">
				<view class="u-margin-bottom-20 u-padding-20 z-b-r white-bg">
					<view>
						<text>项目名称：{{ item.project_name }}</text>
					</view>
					<view>
						<text>联系电话：{{ item.phone }}</text>
					</view>
					<view>
						<text>项目地址：{{ item.project_address }}</text>
					</view>
					<view>
						<text>起止日期：{{ item.start_date }}—{{ item.end_date }}</text>
					</view>
					<view>
						<text>其他条件：{{ item.others }}</text>
					</view>
				</view>
			</block>
		</template>
		<template v-else>
			<empty-data tipText="暂无招聘信息"></empty-data>
		</template>
	</view>
</template>

<script>
	import {mapState} from "vuex"
	export default {
		data() {
			return {
				dataList:[]
			}
		},
		onLoad() {
			this.initDataList();
		},
		computed:{
			...mapState({
				token:"token"
			})
		},
		methods: {
			async initDataList(){
				let {token} = this;
				this.$loading("正在加载")
				let res = await this.$network({
					api:"main",
					data:{
						action:"recruitment/pmRecruitmentAdmin",
						data:{
							token,
							type:'get',
							data:{
								status:1
							}
						}
					}
				})
				
				uni.hideLoading();
				if(res.status === 0){
					this.dataList = res.data;
				} else {
					this.dataList = []
				}
			}
		}
	}
</script>

<style>

</style>
